use error_chain::*;

error_chain! {
    types {
        Error, ErrorKind, ResultExt, Result;
    }
    foreign_links {
        Io(::std::io::Error);
        Popen(::subprocess::PopenError);
    }
    errors {
        InvaildPathStrConvert {
            description("unable to convert path to str")
            display("unable to convert path to str")
        }
        CompileError(t: String) {
            description("unable to compile program")
            display("unable to compile program with exit code {}", t)
        }
        GenerateDataError(t: String) {
            description("unable to generate data")
            display("unable to generate data with exit code {}", t)
        }
        ProgramError(t: String) {
            description("unable to run program")
            display("unable to run program with exit code {}", t)
        }
    }
}
